Closed (fixed)
Project:
Admin Menu Hider
Version:
5.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
16 Mar 2008 at 15:10 UTC
Updated:
9 Jul 2008 at 08:02 UTC
Hi,
I've been using a javascript snippet with this module to toggle admin menu visibility. It's pretty small and uses jQuery. Maybe you could add something like this.
Here's the snippet I use, if anyone want to give it a try:
if (Drupal.jsEnabled) {
Drupal.admin_menu_fix = {
init: function() {
$("div#admin-menu").children("ul:first").children("li:gt(0)").hide();
$("div#admin-menu").width("24px").height("24px").css("overflow","hidden");
$("img.admin-menu-icon").attr("src","/favicon.ico").css("cursor","pointer").title("Click here to toggle administration menu visibility!");
$("li.admin-menu-icon:first a:first").css("padding","4px");
Drupal.admin_menu_fix.is_ready = true;
Drupal.admin_menu_fix.is_collapsed = true;
$("li.admin-menu-icon:first a:first").click(function() {
this.blur();
if (!Drupal.admin_menu_fix.is_ready) return;
Drupal.admin_menu_fix.is_ready = false;
if (Drupal.admin_menu_fix.is_collapsed) {
$("div#admin-menu").width("100%").css("overflow","visible").children("ul:first").children("li:gt(0)").show();
Drupal.admin_menu_fix.is_collapsed = false;
}
else {
$("div#admin-menu").width("24px").css("overflow","hidden").children("ul:first").children("li:gt(0)").hide();
Drupal.admin_menu_fix.is_collapsed = true;
}
Drupal.admin_menu_fix.is_ready = true;
return false;
});
}
};
$(document).ready(Drupal.admin_menu_fix.init);
}
As it is, just place into any .js file, i.e. admin_menu_toggle.js and then something like the following in your page.tpl.php script.
<?php if (user_access('access administration menu')) : ?>
<script type="text/javascript" src="<?=base_path() . path_to_theme()?>/js/admin_menu_toggle.js"></script>
<?php endif; ?>
Adjust path to suit your needs.
Cheers
Comments
Comment #1
sunI think this feature request is more appropriate for the Administration Menu Dropdown enhancement module. Thus, moving over there.
Comment #2
deciphered commentedLooking into this as a secondary mode.
Comment #3
deciphered commentedNew behavior added to 5.x-2.x-dev and 6.x-2.x-dev which should be available shortly.
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.